package com.ayanami.departmentservice.mapper;

import com.ayanami.departmentservice.entity.TbDepartment;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;


import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ayanami
 * @since 2020-07-28
 */
public interface TbDepartmentMapper extends BaseMapper<TbDepartment> {
    /**
     * 查询
     * @return 返回部门名称并且计数
     */
    List<TbDepartment> findDeptAndCount();

    /**
     * 查询分页
     * @param page 分页对象
     * @param queryWrapper 高级查询
     * @return b
     */
    IPage<TbDepartment> findDept(Page<TbDepartment> page, @Param(Constants.WRAPPER)QueryWrapper<TbDepartment> queryWrapper);
}
